<?php
if (! defined('INMAIN'))
    exit('Error');
if (! isset($sliderOptions))
{
    @include_once dirname(__DIR__) . '/sliderOptions.php';
    if (! isset($sliderOptions) || empty($sliderOptions))
    {
        echo 'Ελλειπές περιεχόμενο / Missing Content';
        return;
    }
}
?>
<div id="middle">
  <div
    id="slider "
    class="flexslider">
    <ul class="slides">

<?php
// Loop through the li's and print the values they support.
// array
// ('pageLink'=>'','sliderTitle'=>'','notification'=>'','picAlt'=>'','picTitle'=>'','picSrc'=>'')

// The images and the info to show on the slider.

foreach ($sliderOptions as $slider)
:
    $link = empty($slider['pageLink']) ? '' : $slider['pageLink'];
    $title = empty($slider['sliderTitle']) ? '' : $slider['sliderTitle'];
    $new = empty($slider['notification']) ? '' : $slider['notification'];
    $fullTitle = empty($title) && empty($new) ? '' : sprintf(
            '<span class="slider-title">%s <span class="new">%s</span></span>',
            $title, $new);
    $pAlt = empty($slider['picAlt']) ? '' : $slider['picAlt'];
    $pTitle = empty($slider['picTitle']) ? '' : $slider['picTitle'];
    $pSrc = empty($slider['picSrc']) ? '' : $slider['picSrc'];
    ?>
<li>
        <a
          href="<?php echo $link; ?>"
          target="_self"> <?php echo $fullTitle; ?> <img
          alt="<?php echo $pAlt; ?>"
          title="<?php echo $pTitle; ?>"
          src="<?php echo $pSrc; ?>" />
        </a>
      </li>
<?php endforeach;?>
</ul>
  </div>
  <div class="h60"></div>
</div>
